FROM python:3.12-slim
WORKDIR /app
COPY src /app/src
COPY fyiban /app/fyiban
ENV TZ=Asia/Shanghai
COPY requirements.txt /app
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
    pip install ./fyiban
RUN pip install -r requirements.txt && \
    rm -rf /app/fyiban && \
    rm -rf ~/.cache/pip
RUN apt-get update && apt-get install -y cron && apt-get clean && \
    echo "0 7 * * * root cd /app/src && python main.py >> /var/log/daily_task.log 2>&1\n" > /etc/cron.d/daily-task

CMD cron && cd /app/src && python main.py sign >> /var/log/daily_task.log 2>&1; tail -f /var/log/daily_task.log

LABEL maintainer="xiao_meng30@qq.com"
LABEL version="0.0.1"